import VueRouter from 'vue-router'
import Vue from 'vue'
Vue.use(VueRouter);


/*登录页面*/
const login = () => import("@/views/page/login/login");
/*内容部分*/
const articleManage = () => import("@/views/page/content/manage-article");
const postArticle = () => import("@/views/page/content/post-article");
const imageManage = () => import("@/views/page/content/manage-image");
const commentManage = () => import("@/views/page/content/manage-comment");
/*首页*/
const index = () => import("@/views/page/dashboard/index");
/*运营*/
const categoryManage = () => import("@/views/page/operation/manage-category");
const loopManage = () => import("@/views/page/operation/loop");
const websitecategory = () => import("@/views/page/operation/website-category")
/*设置*/
const email = () => import("@/views/page/settings/email");
const info = () => import("@/views/page/settings/info");
const friendLink = () => import("@/views/page/settings/friend-link");
const webSizeInfo = () => import("@/views/page/settings/web-size-info");
const website = () => import("@/views/page/settings/web-site-collect");
/*用户*/
const list = () => import("@/views/page/info/userList");

/*系统*/
const syslog = () => import("@/views/page/system/SysLog")
const sysRole =() =>import("@/views/page/system/RoleList")
/*布局*/
const baseView = () => import("@/layout/base-view");
const rightView = () => import("@/layout/right-content");

//全局路由守卫
//陆游器
export const routes = [
  {
    path: '',
    component: baseView,
    redirect: '/index',
    children: [
      {
        path: "/index",
        name: '首页',
        icon: 'home',
        hidden: false,
        component: index
      },
      {
        path: '/content',
        hidden: false,
        name: '内容',
        icon: 'read',
        component: rightView,
        children: [
          {
            path: 'post-article',
            hidden: false,
            icon: 'rocket',
            name: '发表文章',
            component: postArticle
          },
          {
            path: 'manage-article',
            hidden: false,
            icon: 'read',
            name: '文章管理',
            component: articleManage
          },
          {
            path: 'manage-comment',
            icon: 'message',
            hidden: false,
            name: '评论管理',
            component: commentManage
          },
          {
            path: 'manage-image',
            hidden: false,
            icon: 'picture',
            name: '图片管理',
            component: imageManage
          }
        ]
      },
      {
        path: '/info',
        name: '用户',
        icon: 'user',
        hidden: false,
        component: list,

      },
      {
        path: '/operation',
        hidden: false,
        icon: 'alert',
        name: '运营',
        component: rightView,
        children: [
          {
            path: 'category',
            icon: 'profile',
            hidden: false,
            name: '分类管理',
            component: categoryManage
          },
          {
            path: 'loop',
            icon: 'play-square',
            hidden: false,
            name: '轮播图管理',
            component: loopManage
          },
          {
            path: 'website-category',
            icon: 'heart',
            hidden: false,
            name: '网站分类',
            component: websitecategory
          }

        ]
      },
      {
        path: '/settings',
        name: '设置',
        icon: 'setting',
        hidden: false,
        component: rightView,
        children: [

          {
            path: 'email',
            icon: 'mail',
            hidden: false,
            name: '邮箱设置',
            component: email
          },
          {
            path: 'info',
            icon: 'idcard',
            name: '用户信息',
            hidden: false,
            component: info
          },
          {
            path: 'web-size-info',
            hidden: false,
            icon: 'global',
            name: '网站信息',
            component: webSizeInfo
          },
          {
            path: 'friend-link',
            hidden: false,
            icon: 'link',
            name: '友情链接',
            component: friendLink
          },
          {
            path: 'web-site',
            hidden: false,
            icon: 'heart',
            name: '网站收藏',
            component: website
          }
        ]
      },
      {
        path: '/system',
        name: '系统',
        icon: 'desktop',
        hidden: false,
        component: rightView,
        children: [
          {
            path: 'sysRole',
            icon: 'history',
            hidden: false,
            name: '角色管理',
            component: sysRole
          },
          {
            path: 'syslog',
            icon: 'history',
            hidden: false,
            name: '操作日志',
            component: syslog
          },]
      }
    ]
  },
  {
    path: '/login',
    component: login

  }
];
const router = new VueRouter({
  mode: 'history',
  routes: routes
});
export default router
